<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>proxy</title>
</head>
<body>
    <div>
        <p>
            var p = new Proxy(target, handler);
        </p>
        <script>
            var proxy1 = new Proxy({sex:1},{
                get:function(target, key, receiver){//{sex: 1} "hello" Proxy {sex: 1}
                    console.log(...arguments);
                    return '老铁666';
                },
                set:function(target, key, value, receiver){
                    console.log(...arguments);
                    target[key]=value
                    return true
                },
                deleteProperty:function(target, key){
                    console.log('delete ',key,target)
                    delete target[key]
                    return true
                }
            })
            console.log(proxy1.hello) 
            console.log(proxy1.egg=2) 
            console.log(delete proxy1.egg) 

        </script>
    </div>
</body>
</html>
